package org.example.domain.strategy.model.entity;

import lombok.*;
import org.example.domain.strategy.model.vo.RuleLogicCheckTypeVO;

/**
 * 规则动作实体,表示要执行哪种抽奖策略【是走黑名单抽奖还是走权重抽奖】
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity> {

    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();

    //指定规则模式
    private String ruleModel;
    private T data;             //存放用于过滤规则的必要参数信息：策略id，奖品id



    static public class RaffleEntity{

    }


    //抽奖之前
    @EqualsAndHashCode(callSuper = true)
    @Builder
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    static public class RaffleBeforeEntity extends  RaffleEntity{
        //策略Id
        private Long strategyId;

        //权重值key，用于抽奖时可以选择权重抽奖
        private String ruleWeightValueKey;

        //奖品Id，【如果是黑名单用户，用于指明返回哪个固定的奖品】
        private Integer awardId;
    }

    //抽奖之中
    static public class RaffleCenterEntity extends  RaffleEntity{}
    //抽奖之后
    static public class RaffleAfterEntity extends  RaffleEntity{}
}
